#ifndef MANAGEFORM_H
#define MANAGEFORM_H

#include "Interfaces/defs.h"

#include <QWidget>
#include <QStandardItemModel>

namespace Ui {
class ManageForm;
}

class ManageForm : public QWidget
{
    Q_OBJECT

public:
    explicit ManageForm(QWidget *parent = nullptr);
    ~ManageForm();

    void updateAnimes(QList<Core::Anime>);
    void updatependingPosts(QList<Core::Post>);
    void updatependingComments(QList<Core::Comment>);

public slots:
    void animeChanged(int ret);

private slots:
    void on_btnAdd_clicked();

    void on_btnDelete_clicked();

    void on_btnEdit_clicked();

    void on_btnAccept_clicked();

    void on_btnDeleteComment_clicked();

    void on_btnAccept_2_clicked();

    void on_btnDeletePost_clicked();

    void on_btnViewPost_clicked();

private:
    QString findAnimeById(int id);

    Ui::ManageForm *ui;

    QList<Core::Anime> m_animes;
    QStandardItemModel *m_model;

    QList<Core::Post> m_pendingPosts;
    QStandardItemModel *m_postsModel;

    QList<Core::Comment> m_pendingComments;
    QStandardItemModel *m_commentsModel;
};

#endif // MANAGEFORM_H
